<form name="form" ng-init="vm.init();refresh(vm.callback);" ng-submit="vm.evaluate(form.$valid)" novalidate>
  <div class="row x-page-header">
    <div class="col-md-12">
      <div class="x-page-title">POJO 对象推导</div>
      <div class="pull-right">
        <button class="btn btn-primary" ng-disabled="form.$invalid || !vm.parsable || !vm.hasText"
            type="submit">推导</button>
        <div class="btn-group x-btn-list">
          <button id="copy" class="btn btn-success" type="button" data-clipboard-action="copy"
              ng-disabled="vm.code == ''">复制</button>
          <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
              ng-disabled="vm.code == ''">
            <span class="caret"></span>
          </button>
          <ul class="dropdown-menu dropdown-menu-right">
            <li><button type="button" class="btn btn-default btn-block" ng-click="vm.save()">保存文件</button></li>
          </ul>
        </div>
        <button class="btn btn-danger" type="button" ng-click="vm.reset()">重置</button>
      </div>
    </div>
  </div>
  <div class="row x-page-body">
    <div class="col-md-7">
      <fieldset>
        <legend>推导条件<font color="green">（根据文本内容推导出POJO）</font></legend>
        <div class="x-page-scope">
          <div class="form-group">
            <input type="text" class="form-control" placeholder="包名（package）" ng-model="vm.config.package" autofocus>
          </div>
          <div class="form-group">
            <input type="text" name="class" class="form-control" placeholder="类名（class）" ng-model="vm.config.class"
                required ng-class="{'x-invalid': form.$submitted && form['class'].$invalid}">
          </div>
          <div class="form-group">
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.builder">使用Builder方式
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.primitive">使用基本类型
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.gettersAndSetters">包含Getters和Setters
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.constructor">包含构造器
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.hashCodeAndEquals">包含hashCode和equals
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.toString">包含toString
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.serializable">标记为Serializable
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.commentAndAnnotation">注释和注解
            </label>
          </div>
          <div class="form-group">
            <label class="control-label">文本类型：</label>
            <label class="radio-inline">
              <input type="radio" name="textType" value="json" ng-model="vm.config.textType">JSON
            </label>
            <label class="radio-inline">
              <input type="radio" name="textType" value="xml" ng-model="vm.config.textType">XML
            </label>
            <label class="radio-inline">
              <input type="radio" name="textType" value="sql" ng-model="vm.config.textType">SQL
            </label>
            <font color="green">（值类型标识符：{type:Object}）</font>
          </div>
          <div class="x-evaltext">
            <div class="x-editor">
              <pre id="text-editor"></pre>
            </div>
          </div>
        </div>
      </fieldset>
    </div>
    <div class="col-md-5">
      <fieldset>
        <legend>推导结果</legend>
        <div class="x-page-scope">
          <div class="x-editor">
            <pre class="x-output" id="java-viewer"></pre>
          </div>
        </div>
      </fieldset>
    </div>
  </div>
</form>
